package com.site.wisdom_construction.controller.publicModule;

import com.site.wisdom_construction.responseEntity.OneDataResult;
import com.site.wisdom_construction.service.publicModule.BadnessLabourTypeService;
import com.site.wisdom_construction.service.publicModule.SpecialCertificateTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author daiyifei
 * @Date 2021/12/29
 * @Description
 */
@Api(tags = "劳务队不良行为类型接口")
@RestController
@RequestMapping("BadnessLabourType")
@CrossOrigin
public class BadnessLabourTypeController {
    @Autowired
    private BadnessLabourTypeService badnessLabourTypeService;

//    @ApiOperation(value = "增加工种信息", notes = "测试数据:")
//    @PostMapping("/insertProfession")
//    public JsonResult insertProfession(@RequestBody Map map){
//        JsonResult jsonResult = new JsonResult();
//        int i = specialCertificateTypeService.insertProfession(map);
//        if (i==1){
//            jsonResult.setCode(200);
//            jsonResult.setMessage("成功录入工种信息!");
//        }else {
//            jsonResult.setCode(20006);
//            jsonResult.setMessage("录入工种信息失败!");
//        }
//        return jsonResult;
//    }
//
//    @ApiOperation(value = "删除工种信息", notes = "测试数据:")
//    @PostMapping("/deleteProfession")
//    public JsonResult deleteProfession(@RequestBody Map map){
//        JsonResult jsonResult = new JsonResult();
//        int i = professionService.deleteProfession(map);
//        if (i==1){
//            jsonResult.setCode(200);
//            jsonResult.setMessage("成功删除工种信息!");
//        }else {
//            jsonResult.setCode(20006);
//            jsonResult.setMessage("删除工种信息失败!");
//        }
//        return jsonResult;
//    }
//
//    @ApiOperation(value = "修改工种信息", notes = "测试数据:")
//    @PostMapping("/updateProfession")
//    public JsonResult updateProfession(@RequestBody Map map){
//        JsonResult jsonResult = new JsonResult();
//        int i = professionService.updateProfession(map);
//        if (i==1){
//            jsonResult.setCode(200);
//            jsonResult.setMessage("成功修改工种信息!");
//        }else {
//            jsonResult.setCode(20006);
//            jsonResult.setMessage("修改工种信息失败!");
//        }
//        return jsonResult;
//    }
//
//    @ApiOperation(value = "分页模糊查询工种信息", notes = "测试数据:")
//    @PostMapping("/findProfessionByPage")
//    public Page findProfessionByPage(@RequestBody Map map) {
//        Page page = new Page();
//        page.setPageNo((Integer) map.get("pageNo"));
//        page.setPageSize((Integer) map.get("pageSize"));
//        page.setTotal(professionService.Total(map));
//        page.setItems(professionService.findProfessionByPage(map));
//        return page;
//    }

    @ApiOperation(value = "下拉框查询劳务队不良行为类型信息", notes = "测试数据:")
    @PostMapping("/selectBadnessLabourType")
    public OneDataResult selectBadnessLabourType(@RequestBody Map map) {
        OneDataResult oneDataResult = new OneDataResult();
        oneDataResult.setData(badnessLabourTypeService.selectBadnessLabourType());
        return oneDataResult;
    }
}
